//
//  BaseTableViewController.swift
//  XMGWB
//
//  Created by J on 16/2/22.
//  Copyright © 2016年 xiaomage. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController,VisitorViewDelegate {

    //定义一个变量 保存用户当前是否登陆
    var userLogin = UserAccount.userLogin()
    //定义属性保存未登陆界面
    var visitorView :VisitorView?
    
    
    
    override func loadView() {
       
         userLogin ? super.loadView() : serUpViewsitorView()
        
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

    }
    
    //MARK: 内部控制方法
    //创建未登陆界面
    private func serUpViewsitorView(){
        //1.初始化未登陆界面
    let customView = VisitorView()
//    customView.backgroundColor = UIColor.orangeColor()
    view = customView
    visitorView = customView
        customView.delegate = self
        
        
        //2.设置导航条未登录按钮


    }
   

    ///  注册按钮点击
    func regesterButtonClick() {
//        let account = UserAccount()
//        account.loadUserInfo()
    }
    
    func loginButtonClick() {
        ///1.弹出登陆界面
        let oauthVC = OAuthViewController()
        let nav = UINavigationController(rootViewController: oauthVC)
        presentViewController(nav, animated: true, completion: nil)
        
    }
}
